<?php

namespace co2\dev\v0_0_0\bash;

use co2\dev\v0_0_0 as co2;

class cp extends co2\bash

{
	public function
	__construct
	(
		$file,
		$target,
		array $options=null
	)
	
	{
		$this->cmd='cp ';
		
		if(is_array($options))
		
		{
			foreach(array('r','recursive') as $_)
			if(isset($options[$_]) && $options[$_])
			$this->cmd.='-r ';
		}
		
		$this->cmd.=$file.' '.$target;
		
		$this->exec();
	}
}
